public class Test {
    public static void main(String[] args) {
        //认识String_Builder API
        StringBuilder sb = new StringBuilder(); // sb = ""
        StringBuilder sb1 = new StringBuilder("haha");  // sb = "haha"
        sb1.append(1);
        sb1.append(1.11);
        sb1.append(true);
        sb1.append("a");
        System.out.println(sb1);

        //支持链式编程
        StringBuilder s3 = new StringBuilder();
        s3.append(1).append(2).append(3);
        System.out.println(s3);

        //返回字符串的长度
        System.out.println(s3.length());

        //反转字符串
        System.out.println(s3.reverse());

        //将StringBuilder转换为String
        String re = s3.toString();
        System.out.println(re);
    }
}
